<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnRepairAcceptStatusInNoteEntityRelationTable extends AbstractMigration
{
    public function up()
    {
        $this->table('note_entity_relation')
            ->addColumn('repair_accept_status', 'enum', [
                'null' => false,
                'values' => 'default,no,yes',
                'default' => 'default',
                'comment' => '返修接受状态',
            ])
            ->addColumn('from_upstream_step_category_id', 'integer', [
                'null' => false,
                'limit' => 11,
                'default' => 0,
                'comment' => '来自上游环节id',
                'signed' => false,
            ])
            ->save();
    }

    public function down()
    {
        $this->table('note_entity_relation')
            ->removeColumn('repair_accept_status')
            ->removeColumn('from_upstream_step_category_id')
            ->save();
    }
}
